import 'package:flutter/material.dart';
import 'package:im_flutter_sdk_example/utils/global.dart';

class NewsModelProvider with ChangeNotifier {
  

  //新闻点赞
  void newsLikes(String id) async {
    var result = await G.req.news.addNewsLikes(newsId: id);
    print('新闻点赞了$result');
    if (result.data['status'] == 1) {
      // G.toast('点赞成功');
    }
  }

  //新闻取消点赞
  void newsCancelLikes(String id) async {
    var result = await G.req.news.cancelNewsLikes(newsId: id);
    print('新闻点赞了$result');
    if (result.data['status'] == 1) {
      // G.toast('取消点赞');
    }
  }
}
